﻿@using DocProcessingWorkflow.Resources.User
@model DocProcessingWorkflow.Models.User.AddUserViewModel

@{
    ViewBag.Title = Index.Title;
}

@using (Html.BeginForm("Create", "User", FormMethod.Post, new { }))
{
    <div class="row">
        <div class="col-md-12">
          <h2>CREATE NEW USER <span class="glyphicon glyphicon-user pull-right"></span></h2>
          <div id="Message">
            <p class="alert alert-danger alert-dismissable">@TempData["comment"]</p>
          </div>
        </div>
    </div>
    <div class="row">
        <div class="profile">
            <div class="col-md-6">
                <div class="form-group">
                    @Html.HiddenFor(m => m.UserNameHidden, new { @class = "UserNameHidden" })
                    @Html.LabelFor(m => m.UserName, "Username")
                    @Html.TextBoxFor(m => m.UserName, new { @class = "form-control", placeholder = @Index.UserName })
                    @Html.ValidationMessageFor(m => m.UserName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(m => m.Password, "New Password") <a class="help glyphicon glyphicon-question-sign" id="PasswordHelp"></a>
                    @Html.PasswordFor(m => m.Password, new { @class = "form-control", placeholder = @Index.Password }) 
                    @Html.ValidationMessageFor(m => m.Password)
                </div>
                <div class="form-group">
                    @Html.LabelFor(m => m.ConfirmPassword, "Confirm Password")
                    @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control", placeholder = @Index.ConfirmPassword })
                    @Html.ValidationMessageFor(m => m.ConfirmPassword)
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    @Html.LabelFor(m => m.FirstName, "First Name")
                    @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control", placeholder = @Index.FirstName })
                    @Html.ValidationMessageFor(m => m.FirstName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(m => m.LastName, "Last Name")
                    @Html.TextBoxFor(m => m.LastName, new { @class = "form-control", placeholder = @Index.LastName })
                    @Html.ValidationMessageFor(m => m.LastName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(m => m.Email, "Email Address")
                    @Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = @Index.Email })
                    @Html.ValidationMessageFor(m => m.Email)
                </div>
            </div>
        </div>
    </div>
    
    <div class="row">
        @Html.Partial("_UserGroupsRoles",Model.UserGroupsRoles)
    </div>
    
    <div class="row">
        <div class="col-md-12">
            <p class="text-center"><input type="submit" value="@Index.AddUser" class="btn btn-profile" /></p>
        </div>
    </div>
}

<div id="password-popover">
    @Html.Partial("_PasswordComplexity")
</div>

@section Scripts {
  <script src="@Url.Content("~/Scripts/User/user.js")" type="text/javascript"></script>
  <script src="@Url.Content("~/Scripts/User/create.js")" type="text/javascript"></script>
}
